//封装弹窗
export function showToast(title = "", icon = "none", mask = true) {
	let position = icon == "none" ? "bottom" : "center";
	uni.showToast({
		title,
		icon,
		mask,
		position
	})
}

//审核状态组
export const stateLists = [{
	"value": 0,
	"text": "审核中",
	"color": "#f3a73f",
	"bgColor": "#fdedd9"
}, {
	"value": 1,
	"text": "审核通过",
	"color": "#18bc37",
	"bgColor": "#d1f2d7"
}, {
	"value": 2,
	"text": "审核不通过",
	"color": "#e43d33",
	"bgColor": "#fad8d6"
}]

//传入value值返回状态对象
export function stateFormat(value) {
	return stateLists.find(item => item.value == value)
}

//判断管理员角色
export function isAdminRole() {
	// UniCloud.getCurrentUserInfo().role.includes('admin') 获取 role数组中是否有 admin
	if (uniCloud.getCurrentUserInfo().role.includes('admin')) {
		return true
	} else {
		false
	}
}